package lab;

public class Test {
    static double LatestNationalWageTaxStandard(double Money) {
        double Tax = 0;
        double NewTax = 0;
        double OldTax = 0;
        double NewMoney = 0;
        try {
            if (0 <= Money && Money <= 30000) {
                Tax = 0;
            }
            if (30000 < Money && Money <= 48000) {
                NewMoney = Money - 30000;
                Tax = NewMoney * 0.03;
            }
            if (48000 < Money && Money <= 102000) {
                NewMoney = Money - 48000;
                OldTax = 540;
                NewTax = NewMoney * 0.10;
                Tax = OldTax + NewTax;
            }
            if (102000 < Money && Money <= 180000) {
                NewMoney = Money - 8500;
                OldTax = 5940;
                NewTax = NewMoney * 0.20;
                Tax = OldTax + NewTax;
            }
            if (Tax < 0) {
                System.out.println("收入金额有误！");
            }
        } catch (Exception e) {
            System.out.println("收入金额有误！");
        }
        final double Tax1 = Tax;
        return Tax1;
    }

    public static void SplitLine1() {
        for (int i = 1; i < 30; i++) {
            System.out.print("——");
        }
        System.out.println();
    }
    public static void SplitLine2() {
        for (int i = 1; i < 20; i++) {
            System.out.print("— —");
        }
        System.out.println();
    }

    public static void main(String[] args) {
        String _5weekScoringList1[] = { "优", "优", "优", "优", "优"};
        String _5weekScoringList2[] = {  "优", "及格", "优", "及格", "优"};
        String _5weekScoringList3[] = {  "优", "及格", "及格", "及格", "优"};
        String _5weekScoringList4[] = { "及格", "及格", "优", "及格", "及格"};
        String _5weekScoringList5[] = { "及格", "及格", "及格", "及格", "及格"};

        Laboratory Lab1 = new Laboratory(1, "计算机网络实验室", _5weekScoringList1);
        Laboratory Lab2 = new Laboratory(2, "物理实验室", _5weekScoringList2);
        Laboratory Lab3 = new Laboratory(3, "化学实验室", _5weekScoringList3);
        Laboratory Lab4 = new Laboratory(4, "生物实验室", _5weekScoringList4);
        Laboratory Lab5 = new Laboratory(5, "组成原理实验室", _5weekScoringList5);
        Laboratory moren1[] = new Laboratory[5];
        Laboratory moren2[] = new Laboratory[5];
        Students Student1 = new Students(1, "同学一", moren1, 0);
        Students Student2 = new Students(2, "同学二", moren2, 0);
        Student1.setlaboratory(0, moren1, Lab1);
        Student1.setlaboratory(1, moren1, Lab2);
        Student2.setlaboratory(0, moren2, Lab3);
        Student2.setlaboratory(1, moren2, Lab4);
        Student2.setlaboratory(2, moren2, Lab5);

        Student1.WorkStudyIncome(Lab1.getCleanlinessScore(), Student1);
        Student1.WorkStudyIncome(Lab2.getCleanlinessScore(), Student1);
        Student2.WorkStudyIncome(Lab3.getCleanlinessScore(), Student2);
        Student2.WorkStudyIncome(Lab4.getCleanlinessScore(), Student2);
        Student2.WorkStudyIncome(Lab5.getCleanlinessScore(), Student2);
        SplitLine1();
        System.out.println("欢迎使用学生实验室勤工俭学模拟系统！");
        SplitLine1();
        System.out.println("同学一 负责丨" + Student1.getlaboratory()[0].getLaboratoryName() + "丨以及丨"
                + Student1.getlaboratory()[1].getLaboratoryName() + "丨");
        SplitLine2();
        System.out.println("丨" + Student1.getlaboratory()[0].getLaboratoryName() + "丨一学期成绩如下:");
        SplitLine2();
        for (int t = 0; t < 5; t++) {
            System.out.print(Student1.getlaboratory()[0].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine2();
        System.out.println("丨" + Student1.getlaboratory()[1].getLaboratoryName() + "丨一学期成绩如下:");
        SplitLine2();
        for (int t = 0; t < 5; t++) {
            System.out.print(Student1.getlaboratory()[1].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine2();
        System.out.println("其纳税前收入为" + Student1.getmoneyEarned() + "元。");
        SplitLine2();
        Student1.setmoney(LatestNationalWageTaxStandard(Student1.getmoneyEarned()));
        System.out.println("其税收后收入为" + Student1.getmoneyEarned() + "元。");
        SplitLine1();
        System.out.println("同学二 负责丨" + Student2.getlaboratory()[0].getLaboratoryName() + "丨和丨"
                + Student2.getlaboratory()[1].getLaboratoryName() + "丨以及丨" + Student2.getlaboratory()[2].getLaboratoryName()
                + "丨");
        SplitLine2();
        System.out.println("丨" + Student2.getlaboratory()[0].getLaboratoryName() + "丨一学期成绩如下:");
        SplitLine2();
        for (int t = 0; t < 5; t++) {
            System.out.print(Student2.getlaboratory()[0].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine2();
        System.out.println("丨" + Student2.getlaboratory()[1].getLaboratoryName() + "丨一学期成绩如下:");
        SplitLine2();
        for (int t = 0; t < 5; t++) {
            System.out.print(Student2.getlaboratory()[1].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine2();
        System.out.println("丨" + Student2.getlaboratory()[2].getLaboratoryName() + "丨一学期成绩如下:");
        SplitLine2();
        for (int t = 0; t < 5; t++) {
            System.out.print(Student2.getlaboratory()[2].getCleanlinessScore()[t] + " ");
        }
        System.out.println();
        SplitLine2();
        System.out.println("其纳税前收入为" + Student2.getmoneyEarned() + "元。");
        SplitLine2();
        Student2.setmoney(LatestNationalWageTaxStandard(Student2.getmoneyEarned()));
        System.out.println("其税收后收入为" + Student2.getmoneyEarned() + "元。");
        SplitLine1();
    }
}